#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<malloc.h>
//int main()
//{
//	int c = 5,b=0;
//	while (c)
//	{
//		if ((c & 1) != 0)
//		{
//			b++;
//		}
//		c >>= 1;
//	}
//	printf("%d", b);
//}
int main()
{
	int c = 0;
	int a[1000] = { 0 };
	int arr1[] = { 1,2,3,4,5,2,3,4 };
	int arr1size = sizeof(arr1)/sizeof(arr1[0]);
	int arr2[] = { 2,3,4,5,1 };
	int arr2size = sizeof(arr2) / sizeof(arr2[0]);
	int size = arr1size > arr2size ? arr2size : arr1size;
	int* arr =(int*)malloc(sizeof(int) * size);
	
	for (int i = 0; i < arr1size; i++)
	{
		a[arr1[i]] = 1;
	}
	for (int i = 0; i < arr2size; i++)
	{
		if (a[arr2[i]] == 1)
			a[arr2[i]] = 0;
	}
	for (int i = 0; i < size; i++)
	{
		if (a[arr2[i]] == 0)
		{
			arr[c] = arr2[i];
			c++;
		}
	}
	for (int i = 0; i < size; i++)
	{
		printf("%d ", arr[i]);
		
	}
}
